<template>
  <basic-container>
    <avue-crud
        v-bind="bindVal"
        v-on="onEvent"
        :page.sync="page"
        v-model="startForm">
      <template slot-scope="{type,size,row}" slot="menuBtn">
        <el-dropdown-item icon="el-icon-edit" :size="size" @click.native="editActivitView(row)" :type="type">
          设计流程
        </el-dropdown-item>
        <el-dropdown-item icon="el-icon-edit" :size="size" @click.native="deploymentModel(row)" :type="type">
          部署流程
        </el-dropdown-item>
      </template>
    </avue-crud>

  </basic-container>
</template>

<script>
import startCrud from "@/mixins/start-crud.js"
import {deploymentModel} from "@/api/start/activiti/modelApi";

export default startCrud({
      components: {},
      methods: {
        editActivitView(row) {
          let routerJump = this.$router.resolve({path: '/activit/designActivit/' + row.id})
          window.open(routerJump.href, '_blank');
        },
        deploymentModel(row) {
          deploymentModel(row.id).then(res => {
            this.$message.success(`流程id【${row.id}】的流程部署成功`)
            this.refreshChange();
          })
        }
      },

    },
    {
      name: "start/activiti/model"
    }
)
</script>


<style scoped>

</style>
